﻿namespace KinonekoSoftware.CodariaDB.Documents.Personalities
{
    public sealed class Worship : _Intro, IStory
    {
        private string        _images;
        private InstanceCache _idol;
        
        /// <summary>
        /// 背景图
        /// </summary>
        public string DocumentID { get; set; }
        
        /// <summary>
        /// 背景图
        /// </summary>
        public string Image
        {
            get => _images;
            set => SetValue(ref _images, value);
        }

        /// <summary>
        /// 偶像
        /// </summary>
        [BsonIgnore]
        public InstanceCache Idol
        {
            get => _idol;
            set
            {
                _idol = value;

                //
                //
                if (_idol?.Id != DocumentID)
                {
                    DocumentID = _idol?.Id;
                }
            }
        }
    }
}